import React from 'react'
import { Descriptions, Tag } from 'antd'
import CardTitle from './CardTitle'
import { color, ba } from '../../utils/json'
// import moment from 'moment'

export default function VehicleRecording(props) {
  const { data } = props
  const record = data.vehicleDetailsVo ? data.vehicleDetailsVo : {}
  const epaVehicleTypes = {
    '4': '重型柴油车',
    '5': '重型燃气车',
    '20': '双燃料汽车',
    '21': '油电混合汽车',
    '22': '气电混合汽车',
  }
  return (
    <div>
      <CardTitle title="基础信息"></CardTitle>
      <Descriptions>
        <Descriptions.Item label="车架号VIN">
          {record.vehicleFrameNo}
        </Descriptions.Item>
        <Descriptions.Item label="备案状态">
          {record.filingStatus || record.filingStatus === 0 ? (
            <Tag color={color[record.filingStatus]}>
              {ba[record.filingStatus]}
            </Tag>
          ) : (
            '--'
          )}
        </Descriptions.Item>
        <Descriptions.Item label="车辆型号">
          {record.vehicleModel}
        </Descriptions.Item>
        <Descriptions.Item label="发动机型号">
          {record.engineModel}
        </Descriptions.Item>
        <Descriptions.Item label="环保局车辆类型">
          {record.epaVehicleType && epaVehicleTypes[record.epaVehicleType]}
        </Descriptions.Item>
      </Descriptions>
      {/* <CardTitle title="附加信息"></CardTitle>
      <Descriptions>
        <Descriptions.Item label="车体结构">
          {record.vehicleStructure}
        </Descriptions.Item>
        <Descriptions.Item label="核定载重">
          {record.vehicleLoad}
        </Descriptions.Item>
        <Descriptions.Item label="车辆尺寸（长）">
          {record.vehicleLong}
        </Descriptions.Item>
        <Descriptions.Item label="车辆尺寸（宽）">
          {record.vehicleWide}
        </Descriptions.Item>
        <Descriptions.Item label="车辆尺寸（高）">
          {record.vehicleHeight}
        </Descriptions.Item>
        <Descriptions.Item label="总质量">
          {record.grossVehicleMass}
        </Descriptions.Item>
        <Descriptions.Item label="车辆类型">
          {record.vehicleType}
        </Descriptions.Item>
        <Descriptions.Item label="行业类型">
          {record.industryType}
        </Descriptions.Item>
        <Descriptions.Item label="企业简称">
          {record.enterpriseShort}
        </Descriptions.Item>
        <Descriptions.Item label="购买时间">
          {record.buyingDate
            ? moment(record.buyingDate).format('YYYY-MM-DD HH:mm:ss')
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="车牌号码">
          {record.vehicleLicense}
        </Descriptions.Item>
        <Descriptions.Item label="道路运输证号">
          {record.permitNo}
        </Descriptions.Item>
        <Descriptions.Item label="行驶证号">
          {record.drivingLicenseNo}
        </Descriptions.Item>
        <Descriptions.Item label="发动机编号">
          {record.engineNo}
        </Descriptions.Item>
        <Descriptions.Item label="车籍地">
          {record.vehiclePlace}
        </Descriptions.Item>
        <Descriptions.Item label="车辆技术等级">
          {record.technicalLevel}
        </Descriptions.Item>
        <Descriptions.Item label="出厂日期">
          {record.productionDate
            ? moment(record.productionDate).format('YYYY-MM-DD HH:mm:ss')
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="等级评定日期">
          {record.gradeAssessmentDate
            ? moment(record.gradeAssessmentDate).format('YYYY-MM-DD HH:mm:ss')
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="二级维护日期">
          {record.twoMaintenanceDate
            ? moment(record.twoMaintenanceDate).format('YYYY-MM-DD HH:mm:ss')
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="二级维护状态">
          {record.twoMaintenanceStatus}
        </Descriptions.Item>
        <Descriptions.Item label="年审状态">
          {record.yearEvaluationStatus}
        </Descriptions.Item>
        <Descriptions.Item label="年检有效期">
          {record.yearInspectionPeriod
            ? moment(record.yearInspectionPeriod).format('YYYY-MM-DD HH:mm:ss')
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="保险有效期">
          {record.insurancePeriod
            ? moment(record.insurancePeriod).format('YYYY-MM-DD HH:mm:ss')
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="保养有效期">
          {record.maintenancePeriod
            ? moment(record.maintenancePeriod).format('YYYY-MM-DD HH:mm:ss')
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="所属单位名称">
          {record.enterpriseName}
        </Descriptions.Item>
        <Descriptions.Item label="车辆联系人">
          {record.contacts}
        </Descriptions.Item>
        <Descriptions.Item label="车辆联系电话">
          {record.contactPhone}
        </Descriptions.Item>
        <Descriptions.Item label="车辆sim卡号">
          {record.terminalSim}
        </Descriptions.Item>
        <Descriptions.Item label="车辆注册时间">
          {record.registerDate
            ? moment(record.registerDate).format('YYYY-MM-DD HH:mm:ss')
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="所有绑定的sim卡">
          {record.terminalAllSim}
        </Descriptions.Item>
        <Descriptions.Item label="监控平台">
          {record.monitorPlat}
        </Descriptions.Item>
        <Descriptions.Item label="环保局车辆类型">
          {record.epaVehicleType}
        </Descriptions.Item>
        <Descriptions.Item label="运输局车辆类型">
          {record.transVehicleType}
        </Descriptions.Item>
        <Descriptions.Item label="所有者地址">
          {record.ownerAddress}
        </Descriptions.Item>
        <Descriptions.Item label="车牌型号">
          {record.licenseModel}
        </Descriptions.Item>
        <Descriptions.Item label="行政区划">
          {record.administrativeArea}
        </Descriptions.Item>
        <Descriptions.Item label="行政地址">
          {record.administrativeAddress}
        </Descriptions.Item>
        <Descriptions.Item label="总客数">
          {record.totalNumberOfGuest}
        </Descriptions.Item>
        <Descriptions.Item label="整备质量">
          {record.curbWeight}
        </Descriptions.Item>
        <Descriptions.Item label="列车最大总质量">
          {record.maximumTotalMassOfTrain}
        </Descriptions.Item>
        <Descriptions.Item label="入网证号">
          {record.netNumber}
        </Descriptions.Item>
        <Descriptions.Item label="初次登记日期">
          {record.initialRegistrationDate
            ? moment(record.initialRegistrationDate).format(
                'YYYY-MM-DD HH:mm:ss'
              )
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="年检日期">
          {record.maximumTotalMassOfTrain
            ? moment(record.maximumTotalMassOfTrain).format(
                'YYYY-MM-DD HH:mm:ss'
              )
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="强制报废日期">
          {record.netNumber
            ? moment(record.netNumber).format('YYYY-MM-DD HH:mm:ss')
            : ''}
        </Descriptions.Item>
        <Descriptions.Item label="车牌颜色">
          {record.licenseColor}
        </Descriptions.Item>
        <Descriptions.Item label="SN">{record.sn}</Descriptions.Item>
      </Descriptions> */}
      <CardTitle title="备案记录"></CardTitle>
    </div>
  )
}
